﻿using System.Collections.Generic;
using Moonwish.Core;
using Moonwish.Foundation.DataAccess.Interface;
using Moonwish.Foundation.DataEntity;

namespace Moonwish.Foundation.BusinessComponent
{
    public class ValueObjectBC : IValueObjectDA
    {
        private readonly IValueObjectDA _dataAccess;

        public ValueObjectBC()
        {
            var factory = new BusinessComponentFactory<IValueObjectDA>();
            _dataAccess = factory.Create();
        }

        public void Add(List<V_FDT_ValueObject> items, string userId)
        {
            _dataAccess.Add(items, userId);
        }

        public void Update(List<V_FDT_ValueObject> items, string userId)
        {
            _dataAccess.Update(items, userId);
        }

        public void Delete(List<string> ids, string userId)
        {
            _dataAccess.Delete(ids, userId);
        }

        public void Publish(List<string> ids, string userId)
        {
            _dataAccess.Publish(ids, userId);
        }

        public void Disable(List<string> ids, string userId)
        {
            _dataAccess.Publish(ids, userId);
        }

        public List<V_FDT_ValueObject> Query(Request request)
        {
            return _dataAccess.Query(request);
        }
    }
}
